feat: experimental debug hooks across host-api, host-container, host-papp#154
Merged
Conversation
Adds Transport.onDebugMessage(callback) for host-side observability: every message crossing the transport in either direction is surfaced in decoded (non-SCALE) form. Lazy under the hood — wires up through messageProvider so there is no per-message cost while no listener is attached.
Adds onDebugMessage to Container and a process-global onHostApiDebugMessage bus that aggregates traffic across every container, tagged with the productId passed to createContainer. Builds on host-api's transport-level debug hook
Adds a ./debug subpath export so host applications can subscribe to pairing, attestation, and session activity — intended for in-app debug panels and bug reports. The subpath is split from the main entry so consumers can subscribe without loading the verifiablejs WASM the main entry depends on
Contributor
Author
|
@johnthecat can we get a review on this 🙏🏻 |
…ug-hooks # Conflicts: # packages/host-container/package.json # packages/host-papp/src/sso/auth/impl.ts # packages/host-papp/src/sso/sessionManager/impl.ts # packages/host-papp/src/sso/sessionManager/userSession.ts
Imod7
reviewed
May 14, 2026
Imod7
left a comment
There was a problem hiding this comment.
Worth adding a test per file for the emit sites in attestationService.ts, auth/impl.ts, sessionManager/impl.ts, and userSession.ts. Keeps a future refactor from silently dropping them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstreams the experimental debug hooks dotli has been carrying in
vendor/truapi-debug/(vendored viapackage.jsonoverrides) into the official packages. Once this ships, dotli can drop the override block and depend directly onhost-api,host-container, andhost-papp.Original implementation and product context: dotli PR LINK.
Three commits, one per package:
feat(host-api): addsTransport.onDebugMessage(callback)for raw host ↔ product traffic in decoded form. The underlying provider subscription is lazy, so there's no per-message cost while nothing is listening. Each listener is wrapped in its own try/catch so a throwing subscriber can't block other listeners or message delivery.feat(host-container): adds aproductIdoption oncreateContainer, a container-levelonDebugMessage, and a process-globalonHostApiDebugMessageaggregator. Every event the global bus emits is tagged with theproductIdof the container it came from.feat(host-papp): adds a./debugsubpath export carrying a structured event bus for SSO pairing, guest attestation, and session activity. The subpath split keepsverifiablejsWASM out of debug-only consumers; that WASM doesn't initialise cleanly in test runners or some older browsers.The surface was validated end-to-end via dotli's vendored copy (built from this branch).